#include <stdio.h>
#include <string.h>

int main()
{
  FILE *fp = fopen("log.txt", "w+");;
  const char *str_write = "linux is so easy";
  fwrite(str_write, strlen(str_write) + 1, 1, fp);
 
  fseek(fp, 0, SEEK_SET);
  char str_read[1024];
  fread(str_read, strlen(str_write) + 1, 1, fp); 
  printf("%s\n", str_read);
  return 0;
}
